package com.library.management.dto;

import com.fasterxml.jackson.annotation.JsonFormat;
import io.swagger.annotations.ApiModel;
import io.swagger.annotations.ApiModelProperty;
import lombok.Data;

import javax.validation.constraints.NotBlank;
import java.util.Date;

/**
 * 图书DTO
 */
@Data
@ApiModel(value = "图书信息")
public class BookDTO {
    
    @ApiModelProperty(value = "图书ID")
    private Integer id;
    
    @NotBlank(message = "标题不能为空")
    @ApiModelProperty(value = "图书标题", required = true)
    private String title;
    
    @NotBlank(message = "作者不能为空")
    @ApiModelProperty(value = "作者", required = true)
    private String author;
    
    @ApiModelProperty(value = "分类")
    private String category;
    
    @ApiModelProperty(value = "图书描述")
    private String description;
    
    @ApiModelProperty(value = "发布社")
    private String publisher;
    
    @ApiModelProperty(value = "发布日期")
    @JsonFormat(pattern = "yyyy-MM-dd", timezone = "GMT+8")
    private Date publishDate;
    
    @ApiModelProperty(value = "ISBN号")
    private String isbn;
    
    @ApiModelProperty(value = "状态")
    private String status;
    
    @ApiModelProperty(value = "创建时间")
    @JsonFormat(pattern = "yyyy-MM-dd HH:mm:ss", timezone = "GMT+8")
    private Date createdAt;
    
    @ApiModelProperty(value = "更新时间")
    @JsonFormat(pattern = "yyyy-MM-dd HH:mm:ss", timezone = "GMT+8")
    private Date updatedAt;
} 